package com.camel.base.model;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.List;

import com.camel.base.enums.QuestionType;
import com.camel.core.config.RequestEnumJsonDeserialize;
import com.camel.core.entity.BasePaginationEntity;
import com.camel.core.enumhandler.MyIntegerToEnumHandler;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.Data;

/**
 *
 * @author 86183
 * @TableName zs_question
 */
@TableName(value ="zs_question")
@Data
public class ZsQuestion extends BasePaginationEntity implements Serializable {
    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "mrid")
    private String mrid;

    /**
     * 标题
     */
    @TableField(value = "name")
    private String name;

    /**
     * 序号
     */
    @TableField(value = "order_num")
    private Integer orderNum;

    /**
     * 问卷ID
     */
    @TableField(value = "survey_id")
    private Integer surveyId;

    /**
     * 类型
     */
    @TableField(value = "type", typeHandler = MyIntegerToEnumHandler.class)
    @JsonDeserialize(using = RequestEnumJsonDeserialize.class)
    private QuestionType type;

    /**
     * 最少选择
     */
    @TableField(value = "min_select")
    private Integer minSelect;

    /**
     * 最大选择数
     */
    @TableField(value = "max_select")
    private Integer maxSelect;

    /**
     * 必答性
     */
    @TableField(value = "compulsory")
    private Integer compulsory;

    /**
     *
     */
    @TableField(value = "config_type")
    private String configType;

    /**
     * 所属分组
     */
    @TableField(value = "group_name")
    private String groupName;

    @TableField(exist = false)
    private List<ZsOption> children;

    @TableField(exist = false)
    private List<ZsOption> answers;

    @TableField(exist = false)
    private String agentUuid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
